Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/santiagodc8/tu_perfil.net/llms.txt

Use this file to discover all available pages before exploring further.

The administration panel lives at /admin/login. It is separate from the public site and requires a valid email and password to enter.

Logging in

1

Open the login page

Navigate to https://tuperfil.net/admin/login in your browser.
2

Enter your credentials

Type your email address and password in the respective fields, then click Ingresar.
3

You are redirected to the dashboard

On success, Supabase Auth sets a session cookie and the page redirects you to /admin — the dashboard home.
If you see the message “Email o contraseña incorrectos”, check that you are using the email address registered in Supabase Authentication and that caps lock is off.

Creating the first admin user

The panel does not have a public registration page. Admin accounts must be created directly in the Supabase Dashboard.
1

Open your Supabase project

Go to supabase.com/dashboard and select the TuPerfil.net project.
2

Navigate to Authentication → Users

In the left sidebar, click Authentication, then Users.
3

Create the user

Click Add userCreate new user. Enter the email and a strong password, then click Create user.
4

Set the admin role in the profiles table

Go to Table Editorprofiles. Find the newly created row (it is inserted automatically by a trigger), then set the role column to admin.
New users default to the editor role. You must manually upgrade the first account to admin.
Once the profile row has role = 'admin', you can log in at /admin/login and have full access to every section of the panel.

How route protection works

Every URL under /admin (except /admin/login itself) is protected at two levels:
  1. Dashboard layoutsrc/app/admin/(dashboard)/layout.tsx calls supabase.auth.getUser() on every request. If no active session exists, it immediately redirects to /admin/login.
  2. Role check — the layout also reads the profiles table to determine your role (admin or editor). Pages that require admin access call requireAdmin() from src/lib/require-admin.ts, which redirects editors back to /admin if they try to access a restricted page.
Do not share your password or Supabase service-role key. Anyone with admin access can create, edit, and delete articles, users, and all site content.

Logging out

Click Cerrar sesión at the bottom of the sidebar. This calls supabase.auth.signOut(), clears your session, and returns you to /admin/login.